home *** CD-ROM | disk | FTP | other *** search
/ FishMarket 1.0 / FishMarket v1.0.iso / fishies / 551-575 / disk_559 / apig / apiglib_v11.lzh / e14_iffintoscr.rexx < prev    next >
OS/2 REXX Batch file  |  1991-09-28  |  1KB  |  52 lines

  1. /* Example of loading iff pic into custom screen             */
  2. /* A window is not opened, just a screen, no need for a port */
  3.  
  4. /*  */
  5.  x = addlib("apig.library",0,-30,0)
  6.  
  7.  scr = 0 
  8.  
  9.  picture    = loadiff("gorilla") 
  10.  if picture = '0000 0000'x then
  11.     do
  12.        say "I could not find that picture"
  13.        exit
  14.     end
  15.  
  16.  width    = iffwidth(picture)
  17.  height   = iffheight(picture)
  18.  depth    = iffdepth(picture)
  19.  viewmode = iffviewmode(picture)
  20.  ncolors  = iffcolors(picture)
  21.  colors   = iffcolortab(picture)
  22.  
  23.  say "Width     = " width
  24.  say "Depth     = " depth 
  25.  say "Height    = " height 
  26.  say "Viewmode  = " viewmode
  27.  say "Numcolors = " ncolors
  28.  say "ColorTab  = " d2x(c2d(colors))
  29.  
  30.  CUSTOMSCREEN = c2d('000F'x)   /* no point in creating all those globals */
  31.  
  32.  scr   = openscreen(0,0,width,height,depth,1,0,viemode,CUSTOMSCREEN,0)
  33.  scrrp = getscreenrastport(scr) 
  34.  z     = useiffcolor(picture,scr)
  35.  
  36.  /* the following blit copies the IFF image into the screens rastport */
  37.  z     = bltbitmaprastport(picture,0,0,scrrp,0,0,width,height,c2d('00c0'x)) 
  38.  
  39.  /* if you wanna save it */
  40.  /* x = saveiff(picture,"ram:newpic",colors,viewmode,1)  */
  41.  /* x = saveiff(picture,"ram:newpic",colors,viewmode,0)  */
  42.  
  43.  wait 5 sec
  44.  
  45.  x = freebitmap(picture) 
  46.  say "freed bitmap " x  
  47.  
  48.  x = closescreen(scr)
  49.  
  50.  exit 
  51.  
  52.